package com.bw.unit6.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.alipay.tscenter.biz.rpc.vkeydfp.result.BaseResult
import com.bw.unit3.base.BaseViewModel
import com.bw.unit6.base.BaseBean
import com.bw.unit6.bean.UserInfoBean
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch

/**
 *
 * @ClassName: LoginViewModel
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/23 4:39 PM
 * @Version: 1.0
 */
class LoginViewModel:BaseViewModel() {

    val livedataLogin = MutableLiveData<BaseBean<UserInfoBean>>()
    fun login(map: Map<String,String>){
        viewModelScope.launch(Dispatchers.IO) {
            livedataLogin.postValue(apiService.loginjson(map))
        }
    }
}